#include "fxcc/yml/Serializer.h"
#include "e2d/ui/ShaderMetaCacheFile.h"

template<>
void fxcc::yml::Serializer::Encode<ShaderMetaCache>(YAML::Node& node, const ShaderMetaCache& inst)
{
	SetArrayVariable<MetaMapIndex>(node, "m_FragMetas", inst.m_FragMetas);
	SetArrayVariable<MetaMapIndex>(node, "m_SpvMetas", inst.m_SpvMetas);
}


template<>
bool fxcc::yml::Serializer::Decode<ShaderMetaCache>(const YAML::Node& node, ShaderMetaCache& inst)
{
	GetArrayVariable<MetaMapIndex>(node, "m_FragMetas", inst.m_FragMetas);
	GetArrayVariable<MetaMapIndex>(node, "m_SpvMetas", inst.m_SpvMetas);
	return true;
}


template<>
void fxcc::yml::Serializer::Encode<ShaderMetaCacheFile>(YAML::Node& node, const ShaderMetaCacheFile& inst)
{
	SetMapVariable<ShaderMetaCache>(node, "m_Caches", inst.m_Caches);
}


template<>
bool fxcc::yml::Serializer::Decode<ShaderMetaCacheFile>(const YAML::Node& node, ShaderMetaCacheFile& inst)
{
	GetMapVariable<ShaderMetaCache>(node, "m_Caches", inst.m_Caches);
	return true;
}
